In mathematics, the notion of restriction of a function is defined as follows:
If f : E → F is a function from E to F, and A is a subset of E, then the restriction of f to A is the (partial) function
(In rough words, it is "the same function", but only defined on .)
More generally, the restriction (or domain restriction or left-restriction) A ◁ R of a binary relation R between E and F may be defined as a relation having domain A, codomain F and graph G(A ◁ R) = {(x, y) ∈ G(R) | x ∈ A}. Similarly, one can define a right-restriction or range restriction R ▷ B. (Indeed, one could define a restriction to a subset of E x F, and the same applies to n-ary relations. These cases do not fit into the scheme of sheaves.)
The domain anti-restriction of a function or binary relation R (with domain E and codomain F) by a set A may be defined as (E \ A) ◁ R; it removes all elements of A from the domain E. It is sometimes denoted A ⩤ R. The range anti-restriction R ⩥ B is defined by R ▷ (F \ B).